package cn.jszx.core.service.user;

import cn.jszx.core.bean.user.Manager;
import cn.jszx.core.dao.user.ManagerDao;
import cn.jszx.core.query.user.ManagerQuery;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;


@Service
@Transactional
public class ManagerServiceImpl implements ManagerService {

    @Resource
    ManagerDao ManagerDao;

    /**
     * 插入数据库
     *
     * @return
     */
    public Integer addManager(Manager Manager) {
        return ManagerDao.addManager(Manager);
    }

    /**
     * 根据主键查找
     */
    @Transactional(readOnly = true)
    public Manager getManagerByKey(String id) {
        return ManagerDao.getManagerByKey(id);
    }

    @Transactional(readOnly = true)
    public List<Manager> getManagersByKeys(List<String> idList) {
        return ManagerDao.getManagersByKeys(idList);
    }

    /**
     * 根据主键删除
     *
     * @return
     */
    public Integer deleteByKey(String id) {
        return ManagerDao.deleteByKey(id);
    }

    public Integer deleteByKeys(List<String> idList) {
        return ManagerDao.deleteByKeys(idList);
    }

    /**
     * 根据主键更新
     *
     * @return
     */
    public Integer updateManagerByKey(Manager Manager) {
        return ManagerDao.updateManagerByKey(Manager);
    }

    /**
     * 根据条件查询
     *
     * @param ManagerQuery 查询条件
     * @return
     */

    @Transactional(readOnly = true)
    public List<Manager> getManagerList(ManagerQuery ManagerQuery) {
        return ManagerDao.getManagerList(ManagerQuery);
    }


}
